<template>
<h2>子传父</h2>
<h3>当前计数：{{ counter }}</h3>
<!-- 接收子组件的事件 v-on语法糖 -->
<buttonapp @add="clickbutonapp"></buttonapp>
</template>
<script>
import buttonapp from './buttonapp.vue'
export default {
    components: {
        buttonapp
    },
    data() {
        return {
            counter:0
        }
    },
    methods: {
        // 监听函数
        clickbutonapp(count) {
            this.counter+=count
        }
    }
}
</script>
<style scoped>

</style>